/**
 * Created by Brant on 2016/12/28.
 * 邮箱激活
 */
module.exports = function ($http, httpservice, $q) {
    var registerrightService = {};

    /**
     * 邮箱激活
     * @param email
     * @returns {*}
     */
    registerrightService.emailActive = function (email) {
        var params = {
            "email": email
        };
        return $http(
            {
                url: httpservice.emailActiveUrl,
                method: 'POST',
                data: params,
                dataType: 'json',
                headers: {'Content-Type': 'application/json'}
            }
        )
            .then(function (response) {
                return response.data;
            })
            .catch(function (response) {
                console.error('login error', response.status, response.data);
                $("#errormsgId").html("登录失败，失败原因：" + response.status);
            })
            .finally(function () {
                /*$("#errormsgId").html("网络链接失败！");*/
            });
    };

    return registerrightService;
};
